<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@page import="com.nobody.facepk.pojo.SessionUser"%>
<%@page import="com.nobody.facepk.model.Picture"%>
<%@page import="com.nobody.facepk.model.Friends"%>
<%@page import="com.nobody.facepk.model.Comment"%>
<%@page import="com.nobody.facepk.sns.Event"%>
<%@page import="com.nobody.facepk.sns.EventType"%>
<%@page import="com.nobody.facepk.model.User"%>
<%@page import="com.nobody.facepk.service.PictureService"%>
<%@page import="com.nobody.facepk.service.ServiceRegistry"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'choosepicture.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  <%
  List<Picture> pkList = (List)request.getAttribute("pictures");
  long picId  = (Long)request.getAttribute("picId");
  
   %>
  <body>
  <form action="">
   <table>
    	请选择你要PK的照片:<br/>
    	<%
    	if(pkList.size() == 0 ){%>
    	暂无图片。
    	<%}else{
    	for(int i = 0 ; i < pkList.size() ; i ++){
    	Picture  pic  = (Picture)pkList.get(i);
    	String picPath = pic.getPath();
    	String picName = pic.getName();
    	String realPath = "pictures/"+pic.getUserId()+"/"+picPath;
    	%>
    	<a href="match.do?picId=<%=picId%>&targetPicId=<%=pic.getId()%>"><img src="<%=realPath%>" height="80" width="80"/>pk</a>
    	<%
           }
    	 }
    	%>
   	</table>
  
  </form>
  </body>
</html>
